<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>添加客户 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head.html"/>
<script type="text/javascript" src="${base}/thirdparty/datepicker/WdatePicker.js"></script>
<link href="${base}/thirdparty/swfupload2_5/swf.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">var _BASE="${base}/";</script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/swfupload.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/fileprogress.js" charset="utf-8"></script>
<script type="text/javascript" src="${base}/thirdparty/swfupload2_5/handlers_logo.js" charset="utf-8"></script>

<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	// 表单验证
	$inputForm.validate({
		rules: {
			username: {
				required: true,
				pattern: /^[0-9a-z_A-Z\u4e00-\u9fa5]+$/,
				minlength: 2,
				maxlength: 30,
				remote: {
					url: "../v_user_check_username.jspx"
				}
			},
			mobile: { digits:true, minlength:11, remote:{
				url:"../v_user_check_mobile.jspx",
				cache:false
			} },
			email: {email:true, maxlength:100,remote:{
				url:"../v_user_check_email.jspx",
				cache:false
			}},
			password: {
				required: true,
				pattern: /^[^\s&\"<>]+$/,
				minlength: 4,
				maxlength: 20
			},
			rePassword: {
				required: true,
				equalTo: "#password"
			},
			accountFunds: {
				min: 0,
				decimal: {
					integer: 12,
					fraction: 2
				}
			},
			age:{digits:true,maxlength:2},
			qq:{digits:true, minlength:5},
			groupId: "required"
		},
		messages: {
			username: {
				pattern: "非法字符",
				remote: "已存在"
			},
			mobile:{
				remote:"已存在"
			},
			email:{
				remote:"已存在"
			}
		
		}
		
	});
	
});
</script>
</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 添加客户
	</div>
	<form id="inputForm" action="o_save.jspx" method="post"  >
		<table class="input tabContent">
			<tr>
				<th><span class="requiredField">*</span>登录名:</th>
				<td>
					<input type="text" name="username" class="text" maxlength="30" title="只允许为汉字、字母、英文和下划线的组合" />
				</td>
				<th><span class="requiredField">*</span>密码:</th>
				<td>
					<input name="password"  type="password" id="password" class="text" maxlength="100" />
				</td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>确认密码:</th>
				<td>
					<input type="password" name="rePassword"  class="text" maxlength="100"  />
				</td>
				<th><span class="requiredField">*</span>分组</th>
				<td>
					<span class="fieldSet">
						<select name="groupId">
						<#list groupList as r>
							<option value="${r.id!}">${r.name!}</option>
						</#list>
						</select>
					</span>
				</td>
			</tr>
			<tr>
				<th>手机号码:</th>
				<td>
					<input type="text" name="mobile" class="text" maxlength="100" />
				</td>
				<th>Email:</th>
				<td>
					<input type="text" name="email" class="text" maxlength="100" />
				</td>
			</tr>
			<tr>
				<th>状态:</th>
				<td>
					<select name="status">
						<option value="1">正常</option>
						<option value="0">禁用</option>
						<option value="2">开户</option>
					</select>
				</td>
				<th>开户名称:</th>
				<td>
						<input type="text" name="accountName" class="text" maxlength="30"  />
				</td>
			</tr>
			<tr>
				<th>交易账号:</th>
				<td>
						<input type="text" name="account" class="text" maxlength="30"  />
				</td>
				<th>真实姓名:</th>
				<td>
						<input type="text" name="realname" class="text" maxlength="30"  />
				</td>
			</tr>
			<tr>
				<th>联系地址:</th>
				<td>
						<input type="text" name="address" class="text" maxlength="100"  />
				</td>
				<th>联系电话:</th>
				<td>
						<input type="text" name="tel" class="text" maxlength="100"  />
				</td>
			</tr>
			<tr>
				<th>联系QQ:</th>
				<td>
						<input type="text" name="qq" class="text" maxlength="15"  />
				</td>
				<th>证件类型:</th>
				<td>
					<select name="cardType">
						<option value="身份证">身份证</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>身份证号码:</th>
				<td>
						<input type="text" name="idcard" class="text" maxlength="18"  />
				</td>
				<th>年龄:</th>
				<td>
					<input type="text" name="age"  class="text"  maxlength="10"  />
				</td>
			</tr>
			<tr>
				<th>性别:</th>
				<td>
						<select name="gender">
							<option value="1">男</option>
							<option value="0">女</option>
						</select>
				</td>
				<th>结算银行 :</th>
				<td>
						<input type="text" name="bis" class="text" maxlength="18"  />
				</td>
			</tr>
			<tr>
				<th>银行账号 :</th>
				<td>
						<input type="text" name="bankAccount" class="text" maxlength="18"  />
				</td>
				<th>账户资金 :</th>
				<td>
						<input type="text" name="accountFunds" class="text" maxlength="18"  />
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>证件扫描：</th>
				<td>
					<div id='fsUploadProgress'class='clearfix'></div>
					<input type="button" id="uploadBtn" value="选择文件"  class="button"/>
				</td>
			</tr>
		</table>
		<table class="input">
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
					<input type="button" class="button" value="返&nbsp;&nbsp;回" onclick="location.href='v_list.jspx'" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>

<script type='text/javascript'>
var swfu;
var jsessionid = getCookie("JSESSIONID");
var uploadUrl='/all_upload.jhtml';
if(jsessionid) {
	uploadUrl += ";jsessionid="+jsessionid;
}
var settings = {
	post_params: {"directory": "upload"},
	flash_url:"${base}/thirdparty/swfupload2_5/swfupload.swf", 
	flash9_url:"${base}/thirdparty/swfupload2_5/swfupload_fp9.swf", 
	upload_url: uploadUrl,  
	file_size_limit:"1MB", 
	file_types:"*.jpg;*.png;*.gif;*.jpeg", 
	file_types_description:"JPG Images; PNG Image", 
	file_upload_limit:10, 
	file_queue_limit:0, 
	custom_settings:{progressTarget:"fsUploadProgress", cancelButtonId:"btnCancel"}, 
	button_image_url:"${base}/thirdparty/swfupload2_5/choose_file.jpg", 
	button_placeholder_id:"uploadBtn", 
	button_width:175, 
	button_height:52, 
	button_text_top_padding:0, 
	button_window_mode:SWFUpload.WINDOW_MODE.TRANSPARENT, 
	button_cursor:SWFUpload.CURSOR.HAND, 
	swfupload_preload_handler:preLoad, 
	swfupload_load_failed_handler:loadFailed, 
	file_queued_handler:fileQueued, 
	file_queue_error_handler:fileQueueError, 
	upload_start_handler:uploadStart, 
	upload_progress_handler:uploadProgress, 
	upload_error_handler:uploadError, 
	upload_success_handler:uploadSuccess, 
	upload_complete_handler:uploadComplete
};

swfu = new SWFUpload(settings);
$(document).ready(function(){
	if( !swfu.support.loading ){
		$('#fsUploadProgress').html('您当前的Flash Player版本过低,无法支持头像上传,点击<a href="http://get.adobe.com/cn/flashplayer/otherversions/" target="_blank">下载</a>');
	}
})
</script>
